#include "vobject.h"
#include "camera.h"
#include "light.h"
#include "../rsrc/bitmap_manager.h"
#include "animation.h"

#ifndef TERRAGE_VOBJECT_COMPLEX_H_INCLUDED
#define TERRAGE_VOBJECT_COMPLEX_H_INCLUDED

namespace TerraGE {
    class VObject_Complex : public VObject {
        protected:
            ALLEGRO_BITMAP *actual_bit_normal;
            ALLEGRO_BITMAP *actual_bit_shadow;
            ALLEGRO_BITMAP *actual_bit_height;
            float tall;
            float scale;
            bool has_shadow;
            string path;

            bool selected;
            bool hover;

            Light *light;
            Animation_Manager *animation;
        public:
            VObject_Complex(Bitmap_Manager *bm, Camera *cam, string folder, float tx, float ty, float tz, float sc=1.0, bool shad=false);

            float Get_Scale() {return scale;}
            void Set_Scale(float v) {scale = v;}

            float Get_Tall() {return tall;}
            void Set_Tall(float v) {tall = v;}

            void Set_Actual_Bit_Normal(ALLEGRO_BITMAP *v) {actual_bit_normal=v;}
            ALLEGRO_BITMAP *Get_Actual_Bit_Normal() {return actual_bit_normal;}

            void Set_Actual_Bit_Height(ALLEGRO_BITMAP *v) {actual_bit_height=v;}
            ALLEGRO_BITMAP *Get_Actual_Bit_Height() {return actual_bit_height;}

            void Set_Actual_Bit_Shadow(ALLEGRO_BITMAP *v) {actual_bit_shadow=v;}
            ALLEGRO_BITMAP *Get_Actual_Bit_Shadow() {return actual_bit_shadow;}

            void Generate_Shadow_Bit(Camera *cam);
            void Generate_Normal_Map(Bitmap_Manager *bm);

            bool Select_Toggle() {selected = (selected ? false : true);}
            void Select() {selected = true;}
            void Deselect() {selected = false;}
            bool Is_Selected() {return selected;}

            void Set_Hover(bool v) {hover=v;}
            bool Get_Hover() {return hover;}

            void Attach_Light(Light *l) {light=l;}
            Light *Get_Light() {return light;}

            virtual void Update(float timestep);
    };
}


#endif
